<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2022/7/5
  Time: 16:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="mybatis.pojo.Grade" %>
<%@ page import="mybatis.services.GradeService" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2022/7/4
  Time: 14:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<%
    List<Grade> all =(List<Grade>)request.getAttribute("all");
%>
<!--主体内容-->
<%@include file="/checkLogin.jsp"%>
<section class="publicMian ">

    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>课程管理 >> 课程添加</span>
        </div>
        <div class="providerAdd">
            <form action="doAddStudent" method="post"  enctype="multipart/form-data">
                <!--div的class 为error是验证错误，ok是验证成功-->
         <div>
                    <%
                        String msg=(String)request.getAttribute("msg");
                    %>
                    <span style="font-size:40px;color:red;">
                        <%=msg==null?"":msg%>
                    </span>
                </div>
                <div>
                    <label for="sname">学生姓名：</label>
                    <input type="text" name="sname" id="sname" required/>
                    <span >*请输入学生姓名</span>
                </div>
                <div>
                    <label >性别：</label>
                    <input type="radio" name="gender" value="男"/>男
                    <input type="radio" name="gender" value="女" />女
                    <input type="radio" name="gender" value="妖"/>妖
                    <input type="radio" name="gender" value="人妖"/>人妖
                    <span >*</span>
                </div>
                <div>
                    <label for="tel">学生电话：</label>
                    <input type="number" name="tel" id="tel" required/>
                    <span >*请输入电话</span>
                </div>
                <div>
                    <label for="qq">学生qq：</label>
                    <input type="text" name="qq" id="qq" />
                    <span >*请输入qq</span>
                </div>
                <div>
                    <label for="wechat">学生微信：</label>
                    <input type="text" name="wechat" id="wechat" />
                    <span >*请输入微信</span>
                </div>
                <div>
                    <label >年级：</label>
                    <select name="gradeID" >
                        <%
                            for (Grade grade : all) {
                        %>
                        <option value="<%=grade.getId()%>"><%=grade.getGname()%></option>

                        <% } %>
                    </select>
                    <span>*请选择年级</span>
                </div>
                <div>
                    <label for="enterDate">入学时间：</label>
                    <input type="date" name="enterDate" id="enterDate" />
                    <span >*请输入入学时间</span>
                </div>
                <div>
                    <label for="city">来自城市：</label>
                    <input type="text" name="city" id="city" />
                    <span >*请输入来自的城市</span>
                </div>
                <div>
                    <label for="birth">出生日期：</label>
                    <input type="date" name="birth" id="birth" />
                    <span >*请输入出生日期</span>
                </div>
                <div>
                    <label for="address">地址：</label>
                    <input type="text" name="address" id="address" />
                    <span >*请输入地址</span>
                </div>
                <div>
                    <label for="psd">密码：</label>
                    <input type="password" name="psd" id="psd" />
                    <span >*请输入密码</span>
                </div>
                <div>
                    <label for="idcardpic">请上传身份证正面照：</label>
                    <input type="file" accept="img/*" name="idcardpic" id="idcardpic" onchange="setImagePreviews(this);" />
                    <img src="#" id="preview" height="200px" width="150px"/>
                    <span >*请上传身份证正面照</span>
                </div>

                <div class="providerAddBtn">
                    <!--<a href="#">保存</a>-->
                    <!--<a href="billList.html">返回</a>-->
                    <input type="submit" value="保存" />
                    <input type="button" value="返回" onclick="history.back(-1)"/>
                </div>
            </form>
        </div>

    </div>
    <script>
        function setImagePreviews(t){
            var file = t.files[0];//获取input上传1var img = new Image();
            var url = window.URL.createObjectURL(file);//得到bolb对象路径，可当成img.src = url;
            document.getElementById("preview").src=url;

        }
    </script>
</section>
</body>
</html>

